package com.example.administrator.liangcang.fragment;


import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.example.administrator.liangcang.R;
import com.example.administrator.liangcang.message.activity.MessageTopActivity;
import com.example.administrator.liangcang.databinding.FragmentMessageBinding;

/**
 * A simple {@link Fragment} subclass.
 */
public class MessageFragment extends Fragment {
    private FragmentMessageBinding binding;
    public MessageFragment() {
        // Required empty public constructor
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        return DataBindingUtil.inflate(inflater,R.layout.fragment_message, container, false).getRoot();
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
       binding = DataBindingUtil.getBinding(view);
        aboutIntent();
    }

    private void aboutIntent() {
        binding.relativeLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getContext(), MessageTopActivity.class);
                getContext().startActivity(intent);
                getActivity().overridePendingTransition(R.anim.activity_come,0);
            }
        });
    }
}
